<?php
declare(strict_types=1);

namespace App\One\Campaign;

use App\Controller;

// hook controller_one_search_campaign_group_use.php

/**
 * @title   计划
 * @auth    true
 * @login   true
 * @menu    false
 * @component   vlist/index.vue
 * @icon    el-icon-menu
 * @active  true
 * @affix   false
 * @rank    99
 */
class Index extends Controller
{
    // hook controller_one_search_campaign_group_public_start.php


    // hook controller_one_search_campaign_group_public_end.php

    /**
     * @title  下发配置
     * @rank    0
     */
    public function action_Conf_PUT()
    {

        // hook controller_one_search_campaign_group_conf_start.php
        $conf = [
            'groupTotalRow'=>'bottom','grandTotalRow'=>'bottom',
            'pageSize' => 10000, 'remoteSort' => 0, 'remoteFilter' => 0, 'remoteSummary' => 0, 'hidePagination' => 1, 'hideRefresh' => 0,
            'hideDo' => 0, 'add' => 0, 'start' => 0, 'stop' => 0, 'delete' => 0, 'import' => 0,
            'export' => 0, 'pageSizes' => [10, 20, 25, 50, 100, 500, 1000, 10000],
            'TreeData' => 0, 'Local' => 1, 'enable' => 0, 'disable' => 0, 'chartRange' => 0, 'copy' => 0,
            'merge'=>[
                'CampaignGroup'=>['k'=>'campaignGroupId','v'=>'campaignGroupName']
            ]
        ];
        $Columns = [
            ['prop' => 'campaignGroupName', 'label' => '计划组', 'hidden' => 0, 'sortable' => 1,'pinned'=>'left'],
            ['prop' => 'campaignName', 'label' => '计划', 'hidden' => 0, 'sortable' => 1,'aggFunc'=>'合计','pinned'=>'left'],
            ['prop' => 'campaignId', 'label' => '计划ID','width'=>'80px', 'hidden' => 1, 'sortable' => 1],
            ['prop' => 'campaignGroupId', 'label' => '计划组ID','width'=>'80px', 'hidden' => 1, 'sortable' => 1],
        ];
        array_push($Columns,...$this->public_columns) ;
        $Filter = [];
        $Tools = [];

        // hook controller_one_search_campaign_group_conf_end.php
        $this->response('0000', ['Conf' => $conf, 'Filter' => $Filter, 'Tools' => $Tools, 'Columns' => $Columns]);
    }
    //optimizeTarget 拿量目标
    //itemSelectedMode 选品方式
    //promotionScene 营销目标
    //bidType 出价方式
    //constraintType 拿量目标
    //constraintType 选择方案
    //promotionGoals 目标类型

    /**
     * @title  新建计划
     * @rank    99
     */
    public function action_Create_PUT()
    {
        $bizcode = $this->request->param('bizcode', '');
        //$data = array_merge($this->Search(), $this->Display(), $this->Crowd(), $this->Item());
        //$data = arrlist_change_key($data, 'k');
        $data = [
            'onebpSearch' => [
                ['prop'=>'itemSelectedMode','label'=>'选品方式','span'=>24,'component'=>'radioGroup','options'=>['all'=>0,'items'=>['user_define'=>'自定义选品','shop'=>'智能选品（原好货快投）']]],
                ['prop'=>'bidType','label'=>'出价方式','span'=>24,'component'=>'radioGroup','options'=>['all'=>0,'parent'=>'itemSelectedMode','items'=>[
                        'user_define'=>['custom_bid'=>'手动出价','cost_control'=>'控成本投放','max_amount'=>'最大化拿量','roi_control'=>'控投产比投放'],
                        'shop'=>['custom_bid'=>'手动出价','cost_control'=>'控成本投放','max_amount'=>'最大化拿量','roi_control'=>'控投产比投放'],
                    ]
                ]],
                ['prop'=>'optimizeTarget','label'=>'拿量目标','span'=>24,'component'=>'radioGroup','options'=>['all'=>0,'parent'=>'bidType','items'=>[
                    'custom_bid'=>[],
                    'cost_control'=>['click'=>'宝贝点击','conv'=>'直接成交','coll_cart'=>'收藏加购'],
                    'max_amount'=>['click'=>'宝贝点击','conv'=>'直接成交','coll_cart'=>'收藏加购'],
                    'roi_control'=>['roi'=>'投入产出比'],
                ]]],
            ],
             'onebpDisplay' => [
                ['prop'=>'promotionScene','label'=>'营销目标','span'=>24,'component'=>'radioGroup','options'=>['all'=>0,'items'=>[
                    'promotion_scene_crowd'=>'人群方舟','promotion_scene_item'=>'店铺宝贝运营']
                ]],
                ['prop'=>'promotionGoals','label'=>'目标类型','span'=>24,'component'=>'radioGroup','options'=>['all'=>0,'parent'=>'promotionScene','items'=>[
                    'promotion_scene_crowd'=>['shop_crowd'=>'店铺人群运营'],
                    'promotion_scene_item'=>['shop_item'=>'全店宝贝推广','new_item_speed_car'=>'新品飞车'],]
                ]],
                ['prop'=>'optimizeTarget','label'=>'优化目标','span'=>24,'component'=>'radioGroup','options'=>['all'=>0,'parent'=>'promotionGoals','items'=>[
                    'shop_crowd'=>['shop_visit_new'=>'提升访问新客人数','shop_interest_new'=>'提升兴趣新客人数','shop_purchase_new'=>'提升首购新客人数','shop_repurchase'=>'提升复购人数','high_cvr'=>'人群资产转化'],
                    'shop_item'=>['click'=>'促进点击','conv'=>'促进成交','coll_cart'=>'促进加购'],
                    'new_item_speed_car'=>['click'=>'促进点击','conv'=>'促进成交','coll_cart'=>'促进加购'],]
                ]],
                ['prop'=>'bidType','label'=>'出价方式','span'=>24,'component'=>'radioGroup','options'=>['all'=>0,'parent'=>'optimizeTarget','items'=>[
                        'shop_visit_new'=>['custom_bid'=>'手动出价','max_amount'=>'最大化拿量'],
                        'shop_interest_new'=>['custom_bid'=>'手动出价','max_amount'=>'最大化拿量'],
                        'shop_purchase_new'=>['custom_bid'=>'手动出价','max_amount'=>'最大化拿量'],
                        'shop_repurchase'=>['custom_bid'=>'手动出价','max_amount'=>'最大化拿量'],
                        'high_cvr'=>['custom_bid'=>'手动出价','max_amount'=>'最大化拿量'],
                        'shop'=>['custom_bid'=>'手动出价','cost_control'=>'控成本投放','max_amount'=>'最大化拿量','roi_control'=>'控投产比投放'],
                    ]
                ]],
                ['prop'=>'constraintType','label'=>'控成本类型','span'=>24,'component'=>'radioGroup','options'=>['all'=>0,'parent'=>'bidType','items'=>[
                    'custom_bid'=>[],
                    'cost_control'=>['click'=>'宝贝点击','conv'=>'收藏加购','coll_cart'=>'直接成交'],
                    'max_amount'=>['click'=>'宝贝点击','conv'=>'收藏加购','coll_cart'=>'直接成交'],
                    'roi_control'=>['roi'=>'投入产出比'],
                    ]
                ]],
                ['prop'=>'itemSelectedMode','label'=>'选品方式','span'=>24,'component'=>'radioGroup','options'=>['all'=>0,'items'=>['user_define'=>'自定义选品','shop'=>'智能选品']]],
            ],
        ];
        $this->response('0000', ['solution' => $data[$bizcode]]);
    }

    /**
     * @title  下发Display
     * @rank    99
     */
    public function Display()
    {
        // hook api_component_display_start.php
        $data = [
            ['k' => "onebpDisplay", 'name' => "精准人群运营", 'solution' => [

                'promotionModel' => [
                    ['k' => 'display', 'name' => '持续推广']
                ],
                'promotionScene' => [
                    ['k' => 'promotion_scene_item', 'name' => '店铺宝贝运营', 'promotionGoals' => [
                        ['k' => 'shop_item', 'name' => '全店宝贝推广', 'optimizeTarget' => [
                            ['k' => 'click', 'name' => '促进点击', 'bidType' => [
                                ['k' => 'custom_bid', 'name' => '手动出价', 'constraintType' => [

                                ]],
                                ['k' => 'cost_control', 'name' => '控成本投放', 'constraintType' => [
                                    ['k' => 'click', 'name' => '点击'],
                                ]],
                                ['k' => 'max_amount', 'name' => '最大化拿量', 'constraintType' => [

                                ]],
                            ]],
                            ['k' => 'conv', 'name' => '促进成交', 'bidType' => [
                                ['k' => 'custom_bid', 'name' => '手动出价', 'constraintType' => [

                                ]],
                                ['k' => 'cost_control', 'name' => '控成本投放', 'constraintType' => [
                                    ['k' => 'click', 'name' => '点击'],
                                    ['k' => 'conv', 'name' => '成交'],
                                ]],
                                ['k' => 'roi_control', 'name' => '控投产比投放', 'constraintType' => [
                                    ['k' => 'roi', 'name' => '控投产'],
                                ]],
                                ['k' => 'max_amount', 'name' => '最大化拿量', 'constraintType' => [

                                ]],
                            ]],

                            ['k' => 'coll_cart', 'name' => '促进加购', 'bidType' => [
                                ['k' => 'custom_bid', 'name' => '手动出价', 'constraintType' => [

                                ]],
                                ['k' => 'cost_control', 'name' => '控成本投放', 'constraintType' => [
                                    ['k' => 'click', 'name' => '点击'],
                                    ['k' => 'coll_cart', 'name' => '收藏加购'],
                                ]],
                                ['k' => 'max_amount', 'name' => '最大化拿量', 'constraintType' => [

                                ]],
                            ]],
                            ['k' => 'exposure_pv', 'name' => '促进曝光', 'bidType' => [
                                ['k' => 'custom_bid', 'name' => '手动出价', 'constraintType' => [

                                ]],
                            ]],
                        ]],
                        ['k' => 'new_item_speed_car', 'name' => '新品飞车', 'optimizeTarget' => [
                            ['k' => 'deal_target', 'name' => '促直接销量达成', 'bidType' => [
                                ['k' => 'max_amount', 'name' => '促直接销量达成', 'constraintType' => [

                                ]],

                            ]], ['k' => 'click', 'name' => '促进点击', 'bidType' => [
                                ['k' => 'custom_bid', 'name' => '手动出价', 'constraintType' => [

                                ]],
                                ['k' => 'cost_control', 'name' => '控成本投放', 'constraintType' => [
                                    ['k' => 'click', 'name' => '点击'],
                                ]],
                                ['k' => 'max_amount', 'name' => '最大化拿量', 'constraintType' => [

                                ]],
                            ]],
                            ['k' => 'conv', 'name' => '促进成交', 'bidType' => [
                                ['k' => 'custom_bid', 'name' => '手动出价', 'constraintType' => [

                                ]],
                                ['k' => 'cost_control', 'name' => '控成本投放', 'constraintType' => [
                                    ['k' => 'click', 'name' => '点击'],
                                    ['k' => 'conv', 'name' => '成交'],
                                ]],
                                ['k' => 'roi_control', 'name' => '控投产比投放', 'constraintType' => [
                                    ['k' => 'roi', 'name' => '控投产'],
                                ]],
                                ['k' => 'max_amount', 'name' => '最大化拿量', 'constraintType' => [

                                ]],
                            ]],
                            ['k' => 'coll_cart', 'name' => '促进加购', 'bidType' => [
                                ['k' => 'custom_bid', 'name' => '手动出价', 'constraintType' => [

                                ]],
                                ['k' => 'cost_control', 'name' => '控成本投放', 'constraintType' => [
                                    ['k' => 'click', 'name' => '点击'],
                                    ['k' => 'coll_cart', 'name' => '收藏加购'],
                                ]],
                                ['k' => 'max_amount', 'name' => '最大化拿量', 'constraintType' => [

                                ]],
                            ]],
                        ]],
                    ]],
                    ['k' => 'promotion_scene_crowd', 'name' => '人群方舟', 'promotionGoals' => [
                        ['k' => 'shop_crowd', 'name' => '店铺人群运营(人群方舟)', 'optimizeTarget' => [
                            ['k' => 'shop_visit_new', 'name' => '提升访问新客人数', 'bidType' => [
                                ['k' => 'custom_bid', 'name' => '手动出价', 'constraintType' => [

                                ]],
                                ['k' => 'max_amount', 'name' => '最大化拿量', 'constraintType' => [

                                ]],

                            ]],
                            ['k' => 'shop_interest_new', 'name' => '提升兴趣新客人数', 'bidType' => [
                                ['k' => 'custom_bid', 'name' => '手动出价', 'constraintType' => [

                                ]],
                                ['k' => 'max_amount', 'name' => '最大化拿量', 'constraintType' => [

                                ]],

                            ]],
                            ['k' => 'shop_purchase_new', 'name' => '提升首购新客人数', 'bidType' => [
                                ['k' => 'custom_bid', 'name' => '手动出价', 'constraintType' => [

                                ]],
                                ['k' => 'roi_control', 'name' => '控投产比投放', 'constraintType' => [
                                    ['k' => 'roi', 'name' => '控投产']
                                ]],
                                ['k' => 'max_amount', 'name' => '最大化拿量', 'constraintType' => [

                                ]],

                            ]],
                            ['k' => 'shop_repurchase', 'name' => '提升复购人数', 'bidType' => [
                                ['k' => 'custom_bid', 'name' => '手动出价', 'constraintType' => [

                                ]],
                                ['k' => 'roi_control', 'name' => '控投产比投放', 'constraintType' => [
                                    ['k' => 'roi', 'name' => '控投产']
                                ]],
                                ['k' => 'max_amount', 'name' => '最大化拿量', 'constraintType' => [

                                ]],

                            ]],
                            ['k' => 'high_cvr', 'name' => '人群资产转化', 'bidType' => [
                                ['k' => 'custom_bid', 'name' => '手动出价', 'constraintType' => [

                                ]],
                                ['k' => 'roi_control', 'name' => '控投产比投放', 'constraintType' => [
                                    ['k' => 'roi', 'name' => '控投产']
                                ]],
                                ['k' => 'max_amount', 'name' => '最大化拿量', 'constraintType' => [

                                ]],

                            ]],
                        ]],
                    ]],

                    ['k' => 'promotion_scene_traffic', 'name' => '宝藏场景', 'promotionGoals' => [
                        ['k' => 'traffic_shoujiao', 'name' => '淘系焦点图', 'optimizeTarget' => [
                            ['k' => 'hf_grass_plant', 'name' => '蓄水互动', 'bidType' => [
                                ['k' => 'custom_bid', 'name' => '手动出价', 'constraintType' => [

                                ]],
                                ['k' => 'max_amount', 'name' => '最大化拿量', 'constraintType' => [

                                ]],
                            ]],
                            ['k' => 'hf_impoundment', 'name' => '预热种草', 'bidType' => [
                                ['k' => 'custom_bid', 'name' => '手动出价', 'constraintType' => [

                                ]],
                                ['k' => 'max_amount', 'name' => '最大化拿量', 'constraintType' => [

                                ]],
                            ]],
                            ['k' => 'hf_harvest', 'name' => '爆发转化', 'bidType' => [
                                ['k' => 'custom_bid', 'name' => '手动出价', 'constraintType' => [

                                ]],
                                ['k' => 'max_amount', 'name' => '最大化拿量', 'constraintType' => [

                                ]],
                                ['k' => 'roi_control', 'name' => '控投产比投放', 'constraintType' => [
                                    ['k' => 'roi', 'name' => '控投产'],
                                ]],

                            ]],
                        ]],
                        ['k' => 'traffic_nd', 'name' => '全屏微详情', 'optimizeTarget' => [
                            ['k' => 'nd_click', 'name' => '提高互动量', 'bidType' => [
                                ['k' => 'custom_bid', 'name' => '手动出价', 'constraintType' => [

                                ]],
                                ['k' => 'max_amount', 'name' => '最大化拿量', 'constraintType' => [

                                ]],
                            ]],
                            ['k' => 'nd_cart', 'name' => '提高加购量', 'bidType' => [
                                ['k' => 'custom_bid', 'name' => '手动出价', 'constraintType' => [

                                ]],
                                ['k' => 'max_amount', 'name' => '最大化拿量', 'constraintType' => [

                                ]],
                            ]],
                            ['k' => 'nd_deal', 'name' => '提高成交量', 'bidType' => [
                                ['k' => 'custom_bid', 'name' => '手动出价', 'constraintType' => [

                                ]],
                                ['k' => 'max_amount', 'name' => '最大化拿量', 'constraintType' => [

                                ]],
                                ['k' => 'roi_control', 'name' => '控投产比投放', 'constraintType' => [
                                    ['k' => 'roi', 'name' => '控投产'],
                                ]],
                            ]],
                        ]],
                    ]],
                ]
            ]],
        ];

        return $data;
    }

    /**
     * @title  下发Item
     * @rank    99
     */

    public function Item()
    {
        $data = [
            ['k' => "onebpAdStrategyProductSpeed", 'name' => "货品加速", 'solution' => [
                'promotionModel' => [
                    ['k' => 'daily', 'name' => '持续推广']
                ],
                'promotionScene' => [
                    ['k' => 'ad_strategy_laxin', 'name' => '商品成长', 'optimizeTarget' => [
                        ['k' => 'ad_strategy_direct_buy', 'name' => '促进直接成交', 'bidType' => [
                            ['k' => 'max_amount', 'name' => '最大化拿量', 'constraintType' => [

                            ]],
                            ['k' => 'cost_control', 'name' => '控成本投放', 'constraintType' => [
                                ['k' => 'click', 'name' => '点击'],
                                ['k' => 'conv', 'name' => '成交'],
                            ]],
                            ['k' => 'roi_control', 'name' => '控投产比投放', 'constraintType' => [
                                ['k' => 'roi', 'name' => '控投产'],
                            ]],

                        ]],
                        ['k' => 'conv', 'name' => '促进全店成交', 'bidType' => [
                            ['k' => 'max_amount', 'name' => '最大化拿量', 'constraintType' => [

                            ]],
                            ['k' => 'cost_control', 'name' => '控成本投放', 'constraintType' => [
                                ['k' => 'click', 'name' => '点击'],
                                ['k' => 'conv', 'name' => '成交'],
                            ]],
                            ['k' => 'roi_control', 'name' => '控投产比投放', 'constraintType' => [
                                ['k' => 'roi', 'name' => '控投产'],
                            ]],

                        ]],
                        ['k' => 'coll_cart', 'name' => '促进收藏加购', 'bidType' => [
                            ['k' => 'max_amount', 'name' => '最大化拿量', 'constraintType' => [

                            ]],
                            ['k' => 'cost_control', 'name' => '控成本投放', 'constraintType' => [
                                ['k' => 'coll_cart', 'name' => '收藏加购'],
                            ]],
                            ['k' => 'roi_control', 'name' => '控投产比投放', 'constraintType' => [
                                ['k' => 'roi', 'name' => '控投产'],
                            ]],

                        ]],
                    ]],
                ]
            ]],
            ['k' => "onebpAdStrategyCeKuan", 'name' => "测款快", 'solution' => [
                'promotionModel' => [
                    ['k' => 'daily', 'name' => '持续推广']
                ],
                'promotionScene' => [
                    ['k' => 'ad_strategy_even_budget', 'name' => '均匀预算', 'optimizeTarget' => [
                        ['k' => 'conv', 'name' => '宝贝成交转化', 'bidType' => [
                            ['k' => 'max_amount', 'name' => '最大化拿量', 'constraintType' => [

                            ]],
                        ]],
                        ['k' => 'click', 'name' => '宝贝拿量', 'bidType' => [
                            ['k' => 'max_amount', 'name' => '最大化拿量', 'constraintType' => [

                            ]],
                        ]],
                        ['k' => 'coll_cart', 'name' => '宝贝收藏加购', 'bidType' => [
                            ['k' => 'max_amount', 'name' => '最大化拿量', 'constraintType' => [

                            ]],
                        ]],
                    ]],
                ]
            ]],
            ['k' => "onebpAdStrategyShangXin", 'name' => "上新快", 'solution' => [
                'promotionModel' => [
                    ['k' => 'daily', 'name' => '持续推广']
                ],
                'promotionScene' => [
                    ['k' => 'ad_strategy_laxin', 'name' => '行业新品加速', 'optimizeTarget' => [
                        ['k' => 'ad_strategy_cool_start', 'name' => '新品托管成长', 'bidType' => [
                            ['k' => 'max_amount', 'name' => '最大化拿量', 'constraintType' => [

                            ]],
                        ]],
                        ['k' => 'click', 'name' => '促进点击', 'bidType' => [
                            ['k' => 'max_amount', 'name' => '最大化拿量', 'constraintType' => [

                            ]],
                            ['k' => 'cost_control', 'name' => '控成本投放', 'constraintType' => [
                                ['k' => 'click', 'name' => '点击'],
                            ]],

                        ]],
                        ['k' => 'coll_cart', 'name' => '促进收藏加购', 'bidType' => [
                            ['k' => 'max_amount', 'name' => '最大化拿量', 'constraintType' => [

                            ]],
                            ['k' => 'cost_control', 'name' => '控成本投放', 'constraintType' => [
                                ['k' => 'coll_cart', 'name' => '收藏加购'],
                            ]],

                        ]],
                        ['k' => 'conv', 'name' => '促进成交', 'bidType' => [
                            ['k' => 'max_amount', 'name' => '最大化拿量', 'constraintType' => [

                            ]],
                            ['k' => 'cost_control', 'name' => '控成本投放', 'constraintType' => [
                                ['k' => 'click', 'name' => '点击'],
                                ['k' => 'conv', 'name' => '成交'],
                            ]],
                            ['k' => 'roi_control', 'name' => '控投产比投放', 'constraintType' => [
                                ['k' => 'roi', 'name' => '控投产'],
                            ]],

                        ]],
                    ]],
                ]
            ]],
            ['k' => "onebpItemMarketing", 'name' => "货品运营升级", 'solution' => [
                'promotionModel' => [
                    ['k' => 'daily', 'name' => '持续推广']
                ],
                'promotionScene' => [
                    ['k' => 'promotion_scene_speed_cekuan', 'name' => '极速测款', 'optimizeTarget' => [
                        ['k' => 'click', 'name' => '促进点击', 'bidType' => [
                            ['k' => 'max_amount', 'name' => '最大化拿量', 'constraintType' => [

                            ]],
                            ['k' => 'cost_control', 'name' => '控成本投放', 'constraintType' => [
                                ['k' => 'click', 'name' => '点击'],
                            ]],

                        ]],
                        ['k' => 'click', 'name' => '促进点击', 'bidType' => [
                            ['k' => 'max_amount', 'name' => '最大化拿量', 'constraintType' => [

                            ]],
                            ['k' => 'cost_control', 'name' => '控成本投放', 'constraintType' => [
                                ['k' => 'click', 'name' => '点击'],
                            ]],

                        ]],
                        ['k' => 'coll_cart', 'name' => '促进收藏加购', 'bidType' => [
                            ['k' => 'max_amount', 'name' => '最大化拿量', 'constraintType' => [

                            ]],
                            ['k' => 'cost_control', 'name' => '控成本投放', 'constraintType' => [
                                ['k' => 'coll_cart', 'name' => '收藏加购'],
                            ]],

                        ]],
                        ['k' => 'conv', 'name' => '总成交金额', 'bidType' => [
                            ['k' => 'max_amount', 'name' => '最大化拿量', 'constraintType' => [

                            ]],
                            ['k' => 'cost_control', 'name' => '控成本投放', 'constraintType' => [
                                ['k' => 'click', 'name' => '点击'],
                                ['k' => 'conv', 'name' => '成交'],
                            ]],
                            ['k' => 'roi_control', 'name' => '控投产比投放', 'constraintType' => [
                                ['k' => 'roi', 'name' => '控投产'],
                            ]],

                        ]],
                        /*
                        ['k' => 'ad_strategy_user_defined_aim', 'name' => '自定义', 'bidType' => [
                            ['k' => 'click', 'name' => '宝贝点击', 'constraintType' => [
                            ]],
                            ['k' => 'cart', 'name' => '收藏加购', 'constraintType' => [
                            ]],
                            ['k' => 'buy', 'name' => '直接成交', 'constraintType' => [
                            ]],
                        ]],*/
                    ]],
                    ['k' => 'ad_strategy_laxin', 'name' => '新品破圈', 'optimizeTarget' => [
                        ['k' => 'ad_strategy_cool_start', 'name' => '新品托管成长', 'bidType' => [
                            ['k' => 'max_amount', 'name' => '最大化拿量', 'constraintType' => [

                            ]],
                            ['k' => 'cost_control', 'name' => '控成本投放', 'constraintType' => [
                                ['k' => 'click', 'name' => '点击'],
                            ]],

                        ]],
                        /*['k' => 'ad_strategy_cool_start_mini_aim', 'name' => '自定义冷起', 'bidType' => [
                            ['k' => 'max_amount', 'name' => '最大化拿量', 'constraintType' => [

                            ]],
                            ['k' => 'cost_control', 'name' => '控成本投放', 'constraintType' => [
                                ['k' => 'click', 'name' => '点击'],
                            ]],

                        ]],*/
                        ['k' => 'click', 'name' => '促进点击', 'bidType' => [
                            ['k' => 'max_amount', 'name' => '最大化拿量', 'constraintType' => [

                            ]],
                            ['k' => 'cost_control', 'name' => '控成本投放', 'constraintType' => [
                                ['k' => 'click', 'name' => '点击'],
                            ]],

                        ]],
                        ['k' => 'coll_cart', 'name' => '促进收藏加购', 'bidType' => [
                            ['k' => 'max_amount', 'name' => '最大化拿量', 'constraintType' => [

                            ]],
                            ['k' => 'cost_control', 'name' => '控成本投放', 'constraintType' => [
                                ['k' => 'coll_cart', 'name' => '收藏加购'],
                            ]],

                        ]],
                        ['k' => 'conv', 'name' => '总成交金额', 'bidType' => [
                            ['k' => 'max_amount', 'name' => '最大化拿量', 'constraintType' => [

                            ]],
                            ['k' => 'cost_control', 'name' => '控成本投放', 'constraintType' => [
                                ['k' => 'click', 'name' => '点击'],
                                ['k' => 'conv', 'name' => '成交'],
                            ]],
                            ['k' => 'roi_control', 'name' => '控投产比投放', 'constraintType' => [
                                ['k' => 'roi', 'name' => '控投产'],
                            ]],

                        ]],

                    ]],
                    ['k' => 'promotion_product_speed_boom', 'name' => '货品加速', 'optimizeTarget' => [
                        ['k' => 'ad_strategy_direct_buy', 'name' => '直接成交金额', 'bidType' => [
                            ['k' => 'max_amount', 'name' => '最大化拿量', 'constraintType' => [

                            ]],
                            ['k' => 'cost_control', 'name' => '控成本投放', 'constraintType' => [
                                ['k' => 'click', 'name' => '点击'],
                            ]],

                        ]],
                        ['k' => 'conv', 'name' => '总成交金额', 'bidType' => [
                            ['k' => 'max_amount', 'name' => '最大化拿量', 'constraintType' => [

                            ]],
                            ['k' => 'cost_control', 'name' => '控成本投放', 'constraintType' => [
                                ['k' => 'click', 'name' => '点击'],
                                ['k' => 'conv', 'name' => '成交'],
                            ]],
                            ['k' => 'roi_control', 'name' => '控投产比投放', 'constraintType' => [
                                ['k' => 'roi', 'name' => '控投产'],
                            ]],

                        ]],
                        ['k' => 'coll_cart', 'name' => '促进收藏加购', 'bidType' => [
                            ['k' => 'max_amount', 'name' => '最大化拿量', 'constraintType' => [

                            ]],
                            ['k' => 'cost_control', 'name' => '控成本投放', 'constraintType' => [
                                ['k' => 'coll_cart', 'name' => '收藏加购'],
                            ]],
                        ]],
                    ]],
                ]
            ]],
        ];
        return $data;
    }

    /**
     * @title  下发Crowd
     * @rank    99
     */

    public function Crowd()
    {
        $data = [
            ['k' => "onebpAdStrategyDkx", 'solution' => [
                'name' => "拉新快",
                'promotionModel' => [
                    ['k' => 'daily', 'name' => '持续推广']
                ],
                'promotionScene' => [
                    ['k' => 'ad_strategy_laxin', 'name' => '精准拉新', 'categoryCrowdType' => [
                        ['k' => '0', 'name' => '全域拉新', 'bidType' => [
                            ['k' => 'max_amount', 'name' => '最大化拿量', 'constraintType' => [

                            ]],
                            ['k' => 'cost_control', 'name' => '控成本投放', 'constraintType' => [
                                ['k' => 'click', 'name' => '点击'],
                                ['k' => 'conv', 'name' => '成交'],
                            ]],
                            ['k' => 'roi_control', 'name' => '控投产比投放', 'constraintType' => [
                                ['k' => 'roi', 'name' => '控投产'],
                            ]],
                        ]],
                        ['k' => '1', 'name' => '同类目拉新', 'bidType' => [
                            ['k' => 'max_amount', 'name' => '最大化拿量', 'constraintType' => [

                            ]],
                        ]],
                        ['k' => '2', 'name' => '跨类目拉新', 'bidType' => [
                            ['k' => 'max_amount', 'name' => '最大化拿量', 'constraintType' => [

                            ]],
                        ]]],
                        'sceneTarget' => [
                            ['k' => 'InShopNew', 'name' => '新客访问', 'bidType' => [

                            ]],
                            ['k' => 'InterestNew', 'name' => '新客兴趣加深', 'bidType' => [

                            ]],
                            ['k' => 'BuyNew', 'name' => '新客成交', 'bidType' => [

                            ]],
                        ],
                        'targetCrowd' => [
                            ['k' => 'ShopNew', 'name' => '店铺新客', 'bidType' => [

                            ]],
                            ['k' => 'brandNew', 'name' => '品牌新客', 'bidType' => [

                            ]],
                        ]
                    ],
                ],
            ]],
            ['k' => "onebpAdStrategyRuHui", 'solution' => [
                'name' => "会员快",
                'promotionModel' => [
                    ['k' => 'daily', 'name' => '持续推广']
                ],
                'promotionScene' => [
                    ['k' => 'ad_strategy_ruhui_new', 'name' => '新会员招募', 'targetCrowd' => [
                        ['k' => 'RuhuiNew', 'name' => '非店铺会员', 'bidType' => [
                            ['k' => 'max_amount', 'name' => '最大化拿量', 'constraintType' => [

                            ]],
                        ]],
                    ]],
                    ['k' => 'ad_strategy_ruhui_old', 'name' => '老会员激活', 'targetCrowd' => [
                        ['k' => 'RuhuiOld', 'name' => '店铺会员&高价值人群拓展', 'bidType' => [
                            ['k' => 'max_amount', 'name' => '最大化拿量', 'constraintType' => [

                            ]],
                        ]],
                    ]],
                ]
            ]],

            ['k' => "onebpAdStrategyLiuZi", 'solution' => [
                'name' => "易获客",
                'promotionModel' => [
                    ['k' => 'daily', 'name' => '持续推广']
                ],
                'promotionScene' => [
                    ['k' => 'ad_strategy_xst_cpc', 'name' => '一键起量', 'optimizeTarget' => [

                    ]],
                ]
            ]],
        ];
        return $data;
    }


    /**
     * @title  下发修改计划组名配置
     * @rank    0
     */
    public function action_EditName_PUT()
    {
        $BizCode = $this->request->param('BizCode','');
        $data=[
            [
                'span'=>12,
                'title'=>"旧的名称",
                'titleGetter' => '"旧的名称("+ form["old_title"]?.trim().split("\n").filter(Boolean).length+")"',
                'formItems'=> [
                    [

                        'prop' => "old_title",
                        'span' => 24,
                        'rows' => 15,
                        'component' => 'input',
                        'valueGetter' => 'data.map(row => row["campaignName"]).join("\r\n")',
                        'valueData' => 'data',
                        'readonly' => true,
                        'type' => 'textarea',
                    ]
                ]
            ],
            [
                'span'=>12,
                'title'=>"新的名称",
                'titleGetter' => '"新的名称("+ form["new_title"]?.trim().split("\n").filter(Boolean).length+")"',
                'formItems'=>[
                    [
                        'prop' => "new_title",
                        'span' => 24,
                        'rows' => 15,
                        'component' => 'input',
                        'valueGetter' => 'data.map(row => row["campaignName"]).join("\r\n")',
                        'valueData' => 'data',
                        'type' => 'textarea',
                    ]
                ],
            ]
        ];
        $config=[
            'labelWidth'=>0,
            'labelPosition'=>'top',
        ];
        $this->response('0000', ['BizCode' =>$BizCode,'data'=>$data,'config'=>$config]);
    }

   /**
     * @title  下发修改日限额配置
     * @rank    0
     */
    public function action_Budget_PUT()
    {
        $BizCode = $this->request->param('BizCode','');
        $data=[
            [
                'span'=>24,
                'formItems'=> [
                    ['prop'=>'way','label'=>'出价方式','span'=>24,'component'=>'radioGroup','options'=>['all'=>0,'items'=>['custom'=>'指定限额','current'=>'当前限额']]],
                    ['prop'=>'bidType','label'=>'调整类型','span'=>24,'component'=>'radioGroup','options'=>['all'=>0,'parent'=>'way','items'=>[
                        'custom'=>['appoint'=>'按数值'],
                        'current'=>['compute'=>'按数值','rate'=>'按百分比'],
                    ]]],
                    ['prop'=>'computemode','label'=>'计算方式','span'=>24,'component'=>'radioGroup','options'=>['all'=>0,'parent'=>'bidType','items'=>[
                        'appoint'=>['quantity'=>'指定'],
                        'compute'=>['add'=>'提高','sub'=>'降低'],
                        'rate'=>['add'=>'提高','sub'=>'降低'],
                    ]]],
                    ['prop'=>'num','label'=>'操作数值','span'=>12,'component'=>'input',],
                ]
            ],
        ];
        $config=[

        ];
        $this->response('0000', ['BizCode' =>$BizCode,'data'=>$data,'config'=>$config]);
    }

    /**
     * @title  下发修改出价方式配置
     * @rank    0
     */
    public function action_Constraint_PUT()
    {
        $BizCode = $this->request->param('BizCode','');
        $data=[
            [
                'span'=>24,
                'formItems'=> [
                    ['prop'=>'way','label'=>'出价方式','span'=>12,'component'=>'radioGroup','options'=>['all'=>0,'items'=>['custom'=>'指定限额','current'=>'当前限额']]],
                    ['prop'=>'bidType','label'=>'调整类型','span'=>12,'component'=>'radioGroup','options'=>['all'=>0,'parent'=>'way','items'=>[
                        'custom'=>['appoint'=>'按数值'],
                        'current'=>['compute'=>'按数值','rate'=>'按百分比'],
                    ]]],
                    ['prop'=>'computemode','label'=>'计算方式','span'=>12,'component'=>'radioGroup','options'=>['all'=>0,'parent'=>'bidType','items'=>[
                        'appoint'=>['quantity'=>'指定'],
                        'compute'=>['add'=>'提高','sub'=>'降低'],
                        'rate'=>['add'=>'提高','sub'=>'降低'],
                    ]]],
                    ['prop'=>'num','label'=>'数值','span'=>12,'component'=>'input',],
                ]
            ],
        ];
        $config=[

        ];
        $this->response('0000', ['BizCode' =>$BizCode,'data'=>$data,'config'=>$config]);
    }
    /**
     * @title  下发投放地域配置
     * @rank    0
     */
    public function action_Address_PUT()
    {
        $BizCode = $this->request->param('BizCode','');
        $data=[
            [
                'span'=>12,
                'title'=>"旧的名称",
                'formItems'=> [
                    [

                        'prop' => "Title",
                        'span' => 24,
                        'rows' => 12,
                        'component' => 'input',
                        'type' => 'textarea',
                    ]
                ]
            ],
            [
                'span'=>12,
                'title'=>"新的名称",
                'formItems'=>[
                    [

                        'prop' => "session_id",
                        'span' => 24,
                        'rows' => 12,
                        'component' => 'input',
                        'type' => 'textarea',
                    ]
                ],
            ]
        ];
        $config=[
            'labelWidth'=>0,
            'labelPosition'=>'top',
        ];
        $this->response('0000', ['BizCode' =>$BizCode,'data'=>$data,'config'=>$config]);
    }

    /**
     * @title  下发分时折扣配置
     * @rank    0
     */
    public function action_LaunchPeriod_PUT()
    {
        $BizCode = $this->request->param('BizCode','');
        $data=[
            [
                'span'=>24,
                'formItems'=> [
                    ['prop'=>'num','label'=>'行业模板','span'=>12,'component'=>'input',],
                    ['prop'=>'num','label'=>'自定模板','span'=>12,'component'=>'input',],
                ]
            ],
        ];
        $config=[
            'labelWidth'=>100,
        ];
        $this->response('0000', ['BizCode' =>$BizCode,'data'=>$data,'config'=>$config]);
    }

    /**
     * @title  下发启停配置
     * @rank    0
     */
    public function action_Status_PUT()
    {
        $BizCode = $this->request->param('BizCode','');
        $data=[
            [
                'span'=>24,
                'formItems'=> [
                    ['prop'=>'mode','label'=>'出价方式','span'=>24,'component'=>'radioGroup','options'=>['all'=>0,'items'=>['custom'=>'指定限额','current'=>'当前限额']]],
                    ['prop'=>'bidType','label'=>'调整方式','span'=>12,'component'=>'radioGroup','options'=>['all'=>0,'parent'=>'mode','items'=>[
                        'current'=>['quantity'=>'按数值','rate'=>'按百分比'],
                    ]]],
                    ['prop'=>'num','label'=>'指定数值','span'=>12,'component'=>'input',],
                ]
            ],
        ];
        $config=[

        ];
        $this->response('0000', ['BizCode' =>$BizCode,'data'=>$data,'config'=>$config]);
    }

    // hook controller_one_search_campaign_group_end.php
}

?>